﻿using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace Grinder.Components
{

    [Designer(typeof(SeparatorPanelContainer))]
    public partial class SeparatorPanel : UserControl
    {
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public Panel ContainerPanel
        {
            get
            {
                return panelContainer;
            }
        }

        public SeparatorPanel()
        {
            InitializeComponent();
        }
    }

    public class SeparatorPanelContainer:ParentControlDesigner
    {
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            var separatorPanel = component as SeparatorPanel;

            if (separatorPanel != null)
                EnableDesignMode(separatorPanel.ContainerPanel, separatorPanel.ContainerPanel.Name);
        }
    }
}
